/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2022-04-27
 * Time: 15:55
public class NineTimes {
    static int NineTime(int a){
        int count=0;
        int temp=a;
        while(temp!=0){
            temp/=10;
            count++;
        }
        temp=a;
        int back;
        int times=0;
        for (int i = 0; i < count; i++) {
           back=temp%10;
            if(back==9){
                times++;
            }
            temp/=10;
        }
        return times;
    }

    public static void main(String[] args) {
        int sum = 0;
        for (int i = 1; i < 101; i++) {
            sum+=NineTime(i);
        }
        System.out.println("出现了"+sum+"个9");
    }
}*/
